<template>
  <!-- vue3组件中的模板结构可以没有根标签div -->
  <div class="app">
    <h3>我是App组件</h3>
    <Suspense>
      <template v-slot:default>
        <Child></Child>
      </template>
      <template v-slot:fallback>
        <h3>加载中。。。。稍等</h3>
      </template>
    </Suspense>
  </div>
</template>

<script>
// import Child from "./components/Child";
import { defineAsyncComponent } from "vue";
const Child = defineAsyncComponent(() => import("./components/Child"));
export default {
  name: "App",
  // eslint-disable-next-line vue/no-unused-components
  components: { Child },
};
</script>

<style>
.app {
  background-color: gray;
  padding: 10px;
}
</style>
